<?php
class LogBehavior extends Behavior {
	public function run(&$params){
		/// 不需要记录日志的模块
		$no_log_module = array(
			'BankRemittance',
			'OtherExpenses',
			'OtherRevenue',
			'ClientIni',
			'FactoryIni',
			'BankIni',
			'LogisticsIni',
			'ClientOtherArrearages',
			'ClientFunds',
			'ClientCheckAccount',
			'FactoryOtherArrearages',
			'FactoryCheckAccount',
			'FactoryFunds',
			'LogisticsOtherArrearages',
			'LogisticsCheckAccount',
			'LogisticsFunds',
		);
		if (in_array(MODULE_NAME,$no_log_module)) {
			return false;
		}
		$log_actions = array(
			'insert',
			'update',
			'delete',
			'resetPasswd',
			'setFinishDetailState',
		);
		if (in_array(ACTION_NAME,$log_actions)) {
			$model = D(MODULE_NAME);
			$model->insertLog($params['id']);
		}
	}
	
}